# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Docs.V1.Model.InsertTableRequest do
  @moduledoc """
  Inserts a table at the specified location. A newline character will be inserted before the inserted table.

  ## Attributes

  *   `columns` (*type:* `integer()`, *default:* `nil`) - The number of columns in the table.
  *   `endOfSegmentLocation` (*type:* `GoogleApi.Docs.V1.Model.EndOfSegmentLocation.t`, *default:* `nil`) - Inserts the table at the end of the given header, footer or document body. A newline character will be inserted before the inserted table. Tables cannot be inserted inside a footnote.
  *   `location` (*type:* `GoogleApi.Docs.V1.Model.Location.t`, *default:* `nil`) - Inserts the table at a specific model index. A newline character will be inserted before the inserted table, therefore the table start index will be at the specified location index + 1. The table must be inserted inside the bounds of an existing Paragraph. For instance, it cannot be inserted at a table's start index (i.e. between an existing table and its preceding paragraph). Tables cannot be inserted inside a footnote or equation.
  *   `rows` (*type:* `integer()`, *default:* `nil`) - The number of rows in the table.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :columns => integer() | nil,
          :endOfSegmentLocation => GoogleApi.Docs.V1.Model.EndOfSegmentLocation.t() | nil,
          :location => GoogleApi.Docs.V1.Model.Location.t() | nil,
          :rows => integer() | nil
        }

  field(:columns)
  field(:endOfSegmentLocation, as: GoogleApi.Docs.V1.Model.EndOfSegmentLocation)
  field(:location, as: GoogleApi.Docs.V1.Model.Location)
  field(:rows)
end

defimpl Poison.Decoder, for: GoogleApi.Docs.V1.Model.InsertTableRequest do
  def decode(value, options) do
    GoogleApi.Docs.V1.Model.InsertTableRequest.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Docs.V1.Model.InsertTableRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
